# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Office do
  @moduledoc """
  Information about an Office held by one or more Officials.

  ## Attributes

  *   `divisionId` (*type:* `String.t`, *default:* `nil`) - The OCD ID of the division with which this office is associated.
  *   `levels` (*type:* `list(String.t)`, *default:* `nil`) - The levels of government of which this office is part. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" and "administrative-area-1".
  *   `name` (*type:* `String.t`, *default:* `nil`) - The human-readable name of the office.
  *   `officialIndices` (*type:* `list(integer())`, *default:* `nil`) - List of indices in the officials array of people who presently hold this office.
  *   `roles` (*type:* `list(String.t)`, *default:* `nil`) - The roles which this office fulfills. Roles are not meant to be exhaustive, or to exactly specify the entire set of responsibilities of a given office, but are meant to be rough categories that are useful for general selection from or sorting of a list of offices.
  *   `sources` (*type:* `list(GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Source.t)`, *default:* `nil`) - A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :divisionId => String.t() | nil,
          :levels => list(String.t()) | nil,
          :name => String.t() | nil,
          :officialIndices => list(integer()) | nil,
          :roles => list(String.t()) | nil,
          :sources => list(GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Source.t()) | nil
        }

  field(:divisionId)
  field(:levels, type: :list)
  field(:name)
  field(:officialIndices, type: :list)
  field(:roles, type: :list)
  field(:sources, as: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Source, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Office do
  def decode(value, options) do
    GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Office.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Office do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
